<?php
namespace Home\Model;
use Think\Model\RelationModel;
class UserModel extends RelationModel{ 
	protected $_link = array( 
		'tag'=>array(
		'mapping_type'  =>self::MANY_TO_MANY,
		'class_name'        =>  'tag',
		'foreign_key'   => 'user_id',
		//'condition'     =>'a.tag_type=1',
		'relation_foreign_key'=>'tag_id',
		'relation_table'  =>'think_user_tag'
		),
	);
}
?>